{% extends "layouts/base.html" %}

{% block title %} 添加工序 {% endblock %}

<!-- Specific CSS goes HERE -->
{% block stylesheets %}{% endblock stylesheets %}

{% block content %}

    <!-- [ Main Content ] start -->
    <section class = "pcoded-main-container">
        <div class = "pcoded-content">
            <!-- [ breadcrumb ] start -->
            <div class = "page-header">
                <div class = "page-block">
                    <div class = "row align-items-center">
                        <div class = "col-md-12">
                            <div class = "page-header-title">
                                <h5 class = "m-b-10">工序表</h5>
                            </div>
                            <ul class = "breadcrumb">
                                <li class = "breadcrumb-item"><a href = "{% url 'index' %}"><i
                                        class = "feather icon-home"></i></a></li>
                                <li class = "breadcrumb-item"><a href = "#!">基础数据</a></li>
                                <li class = "breadcrumb-item"><a href = "#!">工序表</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <!-- [ breadcrumb ] end -->
            <!-- [ Main Content ] start -->
            <div class = "row">

                <!-- [ stiped-table ] start -->
                <div class = "col-xl-12">

                    <div class = "card">
                        <div class = "card-header text-center">
                            <h4>增加新的工序</h4>

                        </div>
                        <div class = "card-body">
                            <div class = "row">
                                <div class = "col-sm-3"></div>
                                <div class = "col-sm-6">
                                    <form action = "{% url 'add_process' %}" method = "post">
                                        {% csrf_token %}
                                        <div class = "input-group mb-3">
                                            <div class = "input-group-prepend">
                                                <span class = "input-group-text" id = "jobNumber">工序名称</span>
                                            </div>
                                            {{ p_form.name }}
                                        </div>
                                        <div class = "form-group mx-sm-3 mb-2 text-center">
                                            <button type = "submit" class = "btn btn-primary mb-2">确定</button>
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <button type = "button" class = "btn btn-primary mb-2" onclick="btn_ret()">取消</button>
                                        </div>
                                    </form>
                                </div>
                                <div class = "col-sm-3"></div>
                            </div>


                            <script>
                                // Example starter JavaScript for disabling form submissions if there are invalid fields
                                (function () {
                                    'use strict';
                                    window.addEventListener('load', function () {
                                        // Fetch all the forms we want to apply custom Bootstrap validation styles to
                                        var forms = document.getElementsByClassName('needs-validation');
                                        // Loop over them and prevent submission
                                        var validation = Array.prototype.filter.call(forms, function (form) {
                                            form.addEventListener('submit', function (event) {
                                                if (form.checkValidity() === false) {
                                                    event.preventDefault();
                                                    event.stopPropagation();
                                                }
                                                form.classList.add('was-validated');
                                            }, false);
                                        });
                                    }, false);
                                })();

                                //点击后返回员工列表页
                                function btn_ret() {
                                    window.location.replace("{% url 'process' %}")
                                }
                            </script>


                        </div>


                    </div>
                </div>
                <!-- [ stiped-table ] end -->

            </div>
            <!-- [ Main Content ] end -->
        </div>
    </section>
    <!-- [ Main Content ] end -->

{% endblock content %}

<!-- Specific Page JS goes HERE  -->
{% block javascripts %}{% endblock javascripts %}
